home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_quik.lha / quickdraw / src / quickdraw.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-09  |  4.5 KB  |  265 lines

  1. /*---------------------------- HEADER quickdraw.h ----------------------------*/
  2. /* Copyright 1989 Brown University -- Jeffrey Vogel                           */
  3. /*----------------------------------------------------------------------------*/
  4.  
  5. /*--------------------------------- typedefs ---------------------------------*/
  6. /*----------------------------------------------------------------------------*/
  7.  
  8. typedef struct  {
  9.    int x, y;
  10. } Point;
  11.  
  12. typedef struct {
  13.    int  top, left, bottom, right;
  14. } Rect;
  15.  
  16. typedef struct {
  17.    int    num_vertices;
  18.    Point  *vertices;
  19. } Polygon;
  20.  
  21.  
  22. /*----------------------------- Type Definitions -----------------------------*/
  23. /* GenericPtr : a generic pointer used as a user pointer                      */
  24. /* FunctionPtr : a pointer to a function that returns void.                   */
  25. /* Boolean : the basic boolean type                                           */
  26. /*----------------------------------------------------------------------------*/
  27.  
  28. typedef void (*FunctionPtr)();
  29. typedef unsigned char Byte;
  30. typedef Byte    Boolean;
  31.  
  32. #ifndef FALSE
  33. #define FALSE  0
  34. #endif
  35.  
  36. #ifndef TRUE
  37. #define TRUE   1
  38. #endif
  39.  
  40. #ifndef NULL
  41. #define NULL   0
  42. #endif
  43.  
  44.  
  45.  
  46. /*-------------------------------- Constants ---------------------------------*/
  47. /*----------------------------------------------------------------------------*/
  48.  
  49. #define QD__MAX_FONTS  4
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. /*----------------------------- Enumerated types -----------------------------*/
  68. /*----------------------------------------------------------------------------*/
  69.  
  70. typedef enum {
  71.    white,
  72.    ltGray,
  73.    gray,
  74.    dkGray,
  75.    black
  76. }  Patterns;
  77.  
  78. typedef enum {
  79.    whiteColor,
  80.    blackColor,
  81.    redColor,
  82.    greenColor,
  83.    blueColor,
  84.    magentaColor,
  85.    cyanColor,
  86.    yellowColor
  87. } Colors;
  88.  
  89. typedef enum {
  90.    patCopy,
  91.    patXor
  92. } PenModes;
  93.  
  94. typedef enum {
  95.    FONT__SMALL,
  96.    FONT__MEDIUM,
  97.    FONT__LARGE,
  98.    FONT__LARGEST
  99. } Fonts;
  100.  
  101. typedef enum {
  102.    LINE_STYLE__SOLID,
  103.    LINE_STYLE__ON_OFF_DASH,
  104.    LINE_STYLE__DOUBLE_DASH
  105. } LineStyles;
  106.  
  107.  
  108. /*---------------------------------- Limits ----------------------------------*/
  109. /*----------------------------------------------------------------------------*/
  110.  
  111. #define LINE_WIDTH__MIN 1
  112. #define LINE_WIDTH__MAX 5
  113.  
  114. #define QD__MAX_COLOR   7
  115.  
  116. /*--------------------------------- Defaults ---------------------------------*/
  117. /*----------------------------------------------------------------------------*/
  118.  
  119. #define LINE_WIDTH__DEFAULT    1
  120. #define FUNCTION__DEFAULT      GXcopy
  121. #define LINE_STYLE__DEFAULT    LineSolid
  122. #define JOIN_STYLE__DEFAULT    JoinMiter
  123. #define FONT__DEFAULT          FONT__MEDIUM
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. /*--------------------------------- Externs ----------------------------------*/
  134. /*----------------------------------------------------------------------------*/
  135.  
  136. extern void  QDclose();
  137. extern void  QDreset();
  138. extern void  QDopen();
  139. extern void  QDallowKeypress();
  140.  
  141. extern void  InitDraw();
  142. extern void  InitDraw4();
  143. extern void  ClearAll();
  144. extern void  QuitDraw();
  145. extern void  GetDrawingRect();
  146. extern void  DrawGrid();
  147. extern void  SetErrorHandler();
  148.  
  149. extern int   Random();
  150. extern void  Randomize();
  151. extern void  WaitDraw();
  152.  
  153. extern Boolean Button();
  154. extern void    GetMouse();
  155. extern void    GetMousePt();
  156.  
  157. extern void    SetLineWidth();
  158. extern void    GetLineWidth();
  159. extern void    SetLineStyle();
  160. extern void    GetLineStyle();
  161. extern void    PenMode();
  162. extern void    GetPenMode();
  163. extern void    SetFont();
  164. extern void    GetFont();
  165.  
  166. extern void    DrawLine();
  167. extern void    EraseLine();
  168.  
  169. extern void    FrameRect();
  170. extern void    PaintRect();
  171. extern void    EraseRect();
  172. extern void    InvertRect();
  173. extern void    FrameOval();
  174. extern void    PaintOval();
  175. extern void    EraseOval();
  176. extern void    InvertOval();
  177. extern void    FrameArc();
  178. extern void    PaintArc();
  179. extern void    EraseArc();
  180. extern void    InvertArc();
  181. extern void    EraseCircle();
  182. extern void    PaintCircle();
  183. extern void    FrameCircle();
  184.  
  185. extern void    DrawString();
  186. extern void    QueryStringSize();
  187.  
  188. extern void    SetRect();
  189. extern void    SetPt();
  190. extern void    OffsetRect();
  191. extern void    InRect();
  192. extern Boolean PtInRect();
  193.  
  194. extern void    SetColor();
  195. extern void    PenPat();
  196.  
  197.  
  198.  
  199. extern void    LineTo();
  200. extern void    MoveTo();
  201.  
  202. extern Polygon CreatePoly();
  203. extern Polygon CopyPoly();
  204. extern void    PolyAddPt();
  205. extern void    PolyQueryPt();
  206. extern void    FramePoly();
  207. extern void    PaintPoly();
  208. extern void    ErasePoly();
  209. extern void    InsetPoly();
  210. extern void    OffsetPoly();
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.